#pragma once
#include <d3d11.h>
#include <d2d1.h>

namespace DXBase
{
	public enum class Format
	{
		Unknown	                   = DXGI_FORMAT_UNKNOWN	                   ,// = 0,
		R32G32B32A32_typeless      = DXGI_FORMAT_R32G32B32A32_TYPELESS      ,// = 1,
		R32G32B32A32_float         = DXGI_FORMAT_R32G32B32A32_FLOAT         ,// = 2,
		R32G32B32A32_uint          = DXGI_FORMAT_R32G32B32A32_UINT          ,// = 3,
		R32G32B32A32_sint          = DXGI_FORMAT_R32G32B32A32_SINT          ,// = 4,
		R32G32B32_typeless         = DXGI_FORMAT_R32G32B32_TYPELESS         ,// = 5,
		R32G32B32_float            = DXGI_FORMAT_R32G32B32_FLOAT            ,// = 6,
		R32G32B32_uint             = DXGI_FORMAT_R32G32B32_UINT             ,// = 7,
		R32G32B32_sint             = DXGI_FORMAT_R32G32B32_SINT             ,// = 8,
		R16G16B16A16_typeless      = DXGI_FORMAT_R16G16B16A16_TYPELESS      ,// = 9,
		R16G16B16A16_float         = DXGI_FORMAT_R16G16B16A16_FLOAT         ,// = 10,
		R16G16B16A16_unorm         = DXGI_FORMAT_R16G16B16A16_UNORM         ,// = 11,
		R16G16B16A16_uint          = DXGI_FORMAT_R16G16B16A16_UINT          ,// = 12,
		R16G16B16A16_snorm         = DXGI_FORMAT_R16G16B16A16_SNORM         ,// = 13,
		R16g16b16a16_sint          = DXGI_FORMAT_R16G16B16A16_SINT          ,// = 14,
		R32g32_typeless            = DXGI_FORMAT_R32G32_TYPELESS            ,// = 15,
		R32g32_float               = DXGI_FORMAT_R32G32_FLOAT               ,// = 16,
		R32g32_uint                = DXGI_FORMAT_R32G32_UINT                ,// = 17,
		R32g32_sint                = DXGI_FORMAT_R32G32_SINT                ,// = 18,
		R32g8x24_typeless          = DXGI_FORMAT_R32G8X24_TYPELESS          ,// = 19,
		D32_float_s8x24_uint       = DXGI_FORMAT_D32_FLOAT_S8X24_UINT       ,// = 20,
		R32_float_x8x24_typeless   = DXGI_FORMAT_R32_FLOAT_X8X24_TYPELESS   ,// = 21,
		X32_typeless_g8x24_uint    = DXGI_FORMAT_X32_TYPELESS_G8X24_UINT    ,// = 22,
		R10g10b10a2_typeless       = DXGI_FORMAT_R10G10B10A2_TYPELESS       ,// = 23,
		R10g10b10a2_unorm          = DXGI_FORMAT_R10G10B10A2_UNORM          ,// = 24,
		R10g10b10a2_uint           = DXGI_FORMAT_R10G10B10A2_UINT           ,// = 25,
		R11g11b10_float            = DXGI_FORMAT_R11G11B10_FLOAT            ,// = 26,
		R8g8b8a8_typeless          = DXGI_FORMAT_R8G8B8A8_TYPELESS          ,// = 27,
		R8g8b8a8_unorm             = DXGI_FORMAT_R8G8B8A8_UNORM             ,// = 28,
		R8g8b8a8_unorm_srgb        = DXGI_FORMAT_R8G8B8A8_UNORM_SRGB        ,// = 29,
		R8g8b8a8_uint              = DXGI_FORMAT_R8G8B8A8_UINT              ,// = 30,
		R8g8b8a8_snorm             = DXGI_FORMAT_R8G8B8A8_SNORM             ,// = 31,
		R8g8b8a8_sint              = DXGI_FORMAT_R8G8B8A8_SINT              ,// = 32,
		R16g16_typeless            = DXGI_FORMAT_R16G16_TYPELESS            ,// = 33,
		R16g16_float               = DXGI_FORMAT_R16G16_FLOAT               ,// = 34,
		R16g16_unorm               = DXGI_FORMAT_R16G16_UNORM               ,// = 35,
		R16g16_uint                = DXGI_FORMAT_R16G16_UINT                ,// = 36,
		R16g16_snorm               = DXGI_FORMAT_R16G16_SNORM               ,// = 37,
		R16g16_sint                = DXGI_FORMAT_R16G16_SINT                ,// = 38,
		R32_typeless               = DXGI_FORMAT_R32_TYPELESS               ,// = 39,
		D32_float                  = DXGI_FORMAT_D32_FLOAT                  ,// = 40,
		R32_float                  = DXGI_FORMAT_R32_FLOAT                  ,// = 41,
		R32_uint                   = DXGI_FORMAT_R32_UINT                   ,// = 42,
		R32_sint                   = DXGI_FORMAT_R32_SINT                   ,// = 43,
		R24g8_typeless             = DXGI_FORMAT_R24G8_TYPELESS             ,// = 44,
		D24_unorm_s8_uint          = DXGI_FORMAT_D24_UNORM_S8_UINT          ,// = 45,
		R24_unorm_x8_typeless      = DXGI_FORMAT_R24_UNORM_X8_TYPELESS      ,// = 46,
		X24_typeless_g8_uint       = DXGI_FORMAT_X24_TYPELESS_G8_UINT       ,// = 47,
		R8g8_typeless              = DXGI_FORMAT_R8G8_TYPELESS              ,// = 48,
		R8g8_unorm                 = DXGI_FORMAT_R8G8_UNORM                 ,// = 49,
		R8g8_uint                  = DXGI_FORMAT_R8G8_UINT                  ,// = 50,
		R8g8_snorm                 = DXGI_FORMAT_R8G8_SNORM                 ,// = 51,
		R8g8_sint                  = DXGI_FORMAT_R8G8_SINT                  ,// = 52,
		R16_typeless               = DXGI_FORMAT_R16_TYPELESS               ,// = 53,
		R16_float                  = DXGI_FORMAT_R16_FLOAT                  ,// = 54,
		D16_unorm                  = DXGI_FORMAT_D16_UNORM                  ,// = 55,
		R16_unorm                  = DXGI_FORMAT_R16_UNORM                  ,// = 56,
		R16_uint                   = DXGI_FORMAT_R16_UINT                   ,// = 57,
		R16_snorm                  = DXGI_FORMAT_R16_SNORM                  ,// = 58,
		R16_sint                   = DXGI_FORMAT_R16_SINT                   ,// = 59,
		R8_typeless                = DXGI_FORMAT_R8_TYPELESS                ,// = 60,
		R8_unorm                   = DXGI_FORMAT_R8_UNORM                   ,// = 61,
		R8_uint                    = DXGI_FORMAT_R8_UINT                    ,// = 62,
		R8_snorm                   = DXGI_FORMAT_R8_SNORM                   ,// = 63,
		R8_sint                    = DXGI_FORMAT_R8_SINT                    ,// = 64,
		A8_unorm                   = DXGI_FORMAT_A8_UNORM                   ,// = 65,
		R1_unorm                   = DXGI_FORMAT_R1_UNORM                   ,// = 66,
		R9g9b9e5_sharedexp         = DXGI_FORMAT_R9G9B9E5_SHAREDEXP         ,// = 67,
		R8g8_b8g8_unorm            = DXGI_FORMAT_R8G8_B8G8_UNORM            ,// = 68,
		G8r8_g8b8_unorm            = DXGI_FORMAT_G8R8_G8B8_UNORM            ,// = 69,
		Bc1_typeless               = DXGI_FORMAT_BC1_TYPELESS               ,// = 70,
		Bc1_unorm                  = DXGI_FORMAT_BC1_UNORM                  ,// = 71,
		Bc1_unorm_srgb             = DXGI_FORMAT_BC1_UNORM_SRGB             ,// = 72,
		Bc2_typeless               = DXGI_FORMAT_BC2_TYPELESS               ,// = 73,
		Bc2_unorm                  = DXGI_FORMAT_BC2_UNORM                  ,// = 74,
		Bc2_unorm_srgb             = DXGI_FORMAT_BC2_UNORM_SRGB             ,// = 75,
		Bc3_typeless               = DXGI_FORMAT_BC3_TYPELESS               ,// = 76,
		Bc3_unorm                  = DXGI_FORMAT_BC3_UNORM                  ,// = 77,
		Bc3_unorm_srgb             = DXGI_FORMAT_BC3_UNORM_SRGB             ,// = 78,
		Bc4_typeless               = DXGI_FORMAT_BC4_TYPELESS               ,// = 79,
		Bc4_unorm                  = DXGI_FORMAT_BC4_UNORM                  ,// = 80,
		Bc4_snorm                  = DXGI_FORMAT_BC4_SNORM                  ,// = 81,
		Bc5_typeless               = DXGI_FORMAT_BC5_TYPELESS               ,// = 82,
		Bc5_unorm                  = DXGI_FORMAT_BC5_UNORM                  ,// = 83,
		Bc5_snorm                  = DXGI_FORMAT_BC5_SNORM                  ,// = 84,
		B5g6r5_unorm               = DXGI_FORMAT_B5G6R5_UNORM               ,// = 85,
		B5g5r5a1_unorm             = DXGI_FORMAT_B5G5R5A1_UNORM             ,// = 86,
		B8g8r8a8_unorm             = DXGI_FORMAT_B8G8R8A8_UNORM             ,// = 87,
		B8g8r8x8_unorm             = DXGI_FORMAT_B8G8R8X8_UNORM             ,// = 88,
		R10g10b10_xr_bias_a2_unorm = DXGI_FORMAT_R10G10B10_XR_BIAS_A2_UNORM ,// = 89,
		B8g8r8a8_typeless          = DXGI_FORMAT_B8G8R8A8_TYPELESS          ,// = 90,
		B8g8r8a8_unorm_srgb        = DXGI_FORMAT_B8G8R8A8_UNORM_SRGB        ,// = 91,
		B8g8r8x8_typeless          = DXGI_FORMAT_B8G8R8X8_TYPELESS          ,// = 92,
		B8g8r8x8_unorm_srgb        = DXGI_FORMAT_B8G8R8X8_UNORM_SRGB        ,// = 93,
		Bc6h_typeless              = DXGI_FORMAT_BC6H_TYPELESS              ,// = 94,
		Bc6h_uf16                  = DXGI_FORMAT_BC6H_UF16                  ,// = 95,
		Bc6h_sf16                  = DXGI_FORMAT_BC6H_SF16                  ,// = 96,
		Bc7_typeless               = DXGI_FORMAT_BC7_TYPELESS               ,// = 97,
		Bc7_unorm                  = DXGI_FORMAT_BC7_UNORM                  ,// = 98,
		Bc7_unorm_srgb             = DXGI_FORMAT_BC7_UNORM_SRGB             ,// = 99,
		Ayuv                       = DXGI_FORMAT_AYUV                       ,// = 100,
		Y410                       = DXGI_FORMAT_Y410                       ,// = 101,
		Y416                       = DXGI_FORMAT_Y416                       ,// = 102,
		Nv12                       = DXGI_FORMAT_NV12                       ,// = 103,
		P010                       = DXGI_FORMAT_P010                       ,// = 104,
		P016                       = DXGI_FORMAT_P016                       ,// = 105,
		_420_opaque                = DXGI_FORMAT_420_OPAQUE                 ,// = 106,
		Yuy2                       = DXGI_FORMAT_YUY2                       ,// = 107,
		Y210                       = DXGI_FORMAT_Y210                       ,// = 108,
		Y216                       = DXGI_FORMAT_Y216                       ,// = 109,
		Nv11                       = DXGI_FORMAT_NV11                       ,// = 110,
		Ai44                       = DXGI_FORMAT_AI44                       ,// = 111,
		Ia44                       = DXGI_FORMAT_IA44                       ,// = 112,
		P8                         = DXGI_FORMAT_P8                         ,// = 113,
		A8p8                       = DXGI_FORMAT_A8P8                       ,// = 114,
		B4g4r4a4_unorm             = DXGI_FORMAT_B4G4R4A4_UNORM             ,// = 115,
		Force_uint                 = DXGI_FORMAT_FORCE_UINT                 ,// = 0xffffffff
	};
	inline Format fromDXGI(DXGI_FORMAT value) { return static_cast<Format>(value); }
	inline DXGI_FORMAT makeDXGI(Format value) { return static_cast<DXGI_FORMAT>(value); }

	// return the byte size of the format
	uint32 GetSize(Format fmt);

	namespace D2D
	{
		public enum class UnitMode
		{ 
			Dips = D2D1_UNIT_MODE_DIPS,
			Pixels = D2D1_UNIT_MODE_PIXELS
		};
		inline D2D1_UNIT_MODE makeD2D(UnitMode m) { return static_cast<D2D1_UNIT_MODE>(m); }
		inline UnitMode fromD2D(D2D1_UNIT_MODE m) { return static_cast<UnitMode>(m); }

		public enum class BITMAP_INTERPOLATION_MODE
		{ 
			NEAREST_NEIGHBOR = D2D1_BITMAP_INTERPOLATION_MODE_NEAREST_NEIGHBOR,
			LINEAR = D2D1_BITMAP_INTERPOLATION_MODE_LINEAR
		};

		public enum class INTERPOLATION_MODE
		{
			NEAREST_NEIGHBOR = D2D1_INTERPOLATION_MODE_NEAREST_NEIGHBOR,
			LINEAR = D2D1_INTERPOLATION_MODE_LINEAR,
			CUBIC = D2D1_INTERPOLATION_MODE_CUBIC,
			MULTI_SAMPLE_LINEAR = D2D1_INTERPOLATION_MODE_MULTI_SAMPLE_LINEAR,
			ANISOTROPIC = D2D1_INTERPOLATION_MODE_ANISOTROPIC,
			HIGH_QUALITY_CUBIC = D2D1_INTERPOLATION_MODE_HIGH_QUALITY_CUBIC,
		};

		//http://msdn.microsoft.com/EN-US/library/windows/desktop/dd368100(v=vs.85).aspx
		public enum class GradientSpreadMethod 
		{ 
		  Pad = D2D1_EXTEND_MODE_CLAMP,
		  Repeat = D2D1_EXTEND_MODE_WRAP,
		  Reflect = D2D1_EXTEND_MODE_MIRROR
		};

		// http://msdn.microsoft.com/EN-US/library/dd368113(v=VS.85,d=hv.2).aspx
		public enum class ColorInterpolationMode
		{
			sRgb = D2D1_GAMMA_2_2,
			scRgb = D2D1_GAMMA_1_0
		};

		public enum  class FIGURE_BEGIN
		{ 
			FILLED = D2D1_FIGURE_BEGIN_FILLED,
			HOLLOW = D2D1_FIGURE_BEGIN_HOLLOW
		};
		public enum class FIGURE_END
		{
			OPEN = D2D1_FIGURE_END_OPEN,
			CLOSED = D2D1_FIGURE_END_CLOSED,
		};
		public enum class FILL_MODE
		{ 
			Alternate = D2D1_FILL_MODE_ALTERNATE,
			Winding = D2D1_FILL_MODE_WINDING
		};
		public enum class PATH_SEGMENT
		{ 
			NONE = D2D1_PATH_SEGMENT_NONE,
			FORCE_UNSTROKED = D2D1_PATH_SEGMENT_FORCE_UNSTROKED,
			FORCE_ROUND_LINE_JOIN = D2D1_PATH_SEGMENT_FORCE_ROUND_LINE_JOIN
		};
		public enum class SWEEP_DIRECTION
		{ 
			COUNTER_CLOCKWISE = D2D1_SWEEP_DIRECTION_COUNTER_CLOCKWISE,
			CLOCKWISE = D2D1_SWEEP_DIRECTION_CLOCKWISE
		};
		public enum class ARC_SIZE
		{ 
			SMALL = D2D1_ARC_SIZE_SMALL,
			LARGE = D2D1_ARC_SIZE_LARGE
		};

		public enum class COMBINE_MODE
		{
			// Produce a geometry representing the set of points contained in either
			// the first or the second geometry.
			UNION = D2D1_COMBINE_MODE_UNION,
			// Produce a geometry representing the set of points common to the first
			// and the second geometries.
			INTERSECT = D2D1_COMBINE_MODE_INTERSECT,
			// Produce a geometry representing the set of points contained in the
			// first geometry or the second geometry, but not both.
			XOR = D2D1_COMBINE_MODE_XOR,
			// Produce a geometry representing the set of points contained in the
			// first geometry but not the second geometry.
			EXCLUDE = D2D1_COMBINE_MODE_EXCLUDE,
		};
		public enum class GEOMETRY_RELATION
		{
			// The relation between the geometries couldn't be determined. This value is never
			// returned by any D2D method.
			UNKNOWN = D2D1_GEOMETRY_RELATION_UNKNOWN,
			// The two geometries do not intersect at all.
			DISJOINT = D2D1_GEOMETRY_RELATION_DISJOINT,
			// The passed in geometry is entirely contained by the object.
			IS_CONTAINED = D2D1_GEOMETRY_RELATION_IS_CONTAINED,
			// The object entirely contains the passed in geometry.
			CONTAINS = D2D1_GEOMETRY_RELATION_CONTAINS,
			// The two geometries overlap but neither completely contains the other.
			OVERLAP = D2D1_GEOMETRY_RELATION_OVERLAP,
		};
		//      Specifies how simple the output of a simplified geometry sink should be.
		public enum class GEOMETRY_SIMPLIFICATION_OPTION 
		{ 
			CUBICS_AND_LINES = D2D1_GEOMETRY_SIMPLIFICATION_OPTION_CUBICS_AND_LINES,
			LINES = D2D1_GEOMETRY_SIMPLIFICATION_OPTION_LINES
		};


	}
	namespace DWrite
	{
		/// <summary>
		/// Direction for how lines of text are placed relative to one another.
		/// </summary>
		public enum class FLOW_DIRECTION
		{
			/// <summary>
			/// Text lines are placed from top to bottom.
			/// </summary>
			TOP_TO_BOTTOM = DWRITE_FLOW_DIRECTION_TOP_TO_BOTTOM
		};

		public enum class MEASURING_MODE
		{
			NATURAL = DWRITE_MEASURING_MODE_NATURAL,
			GDI_CLASSIC = DWRITE_MEASURING_MODE_GDI_CLASSIC,
			GDI_NATURAL = DWRITE_MEASURING_MODE_GDI_NATURAL
		};

		public enum class FONT_WEIGHT
		{
			THIN = DWRITE_FONT_WEIGHT_THIN,
			EXTRA_LIGHT = DWRITE_FONT_WEIGHT_EXTRA_LIGHT,
			ULTRA_LIGHT = DWRITE_FONT_WEIGHT_ULTRA_LIGHT,
			LIGHT = DWRITE_FONT_WEIGHT_LIGHT,
			SEMI_LIGHT = DWRITE_FONT_WEIGHT_SEMI_LIGHT,
			NORMAL = DWRITE_FONT_WEIGHT_NORMAL,
			REGULAR = DWRITE_FONT_WEIGHT_REGULAR,
			MEDIUM = DWRITE_FONT_WEIGHT_MEDIUM,
			DEMI_BOLD = DWRITE_FONT_WEIGHT_DEMI_BOLD,
			SEMI_BOLD = DWRITE_FONT_WEIGHT_SEMI_BOLD,
			WEIGHT_BOLD = DWRITE_FONT_WEIGHT_BOLD,
			EXTRA_BOLD = DWRITE_FONT_WEIGHT_EXTRA_BOLD,
			ULTRA_BOLD = DWRITE_FONT_WEIGHT_ULTRA_BOLD,
			BLACK = DWRITE_FONT_WEIGHT_BLACK,
			HEAVY = DWRITE_FONT_WEIGHT_HEAVY,
			EXTRA_BLACK = DWRITE_FONT_WEIGHT_EXTRA_BLACK,
			ULTRA_BLACK = DWRITE_FONT_WEIGHT_ULTRA_BLACK
		};
		inline DWRITE_FONT_WEIGHT makeD2D(FONT_WEIGHT value) { return static_cast<DWRITE_FONT_WEIGHT>(value); }
		inline FONT_WEIGHT fromD2D(DWRITE_FONT_WEIGHT value) { return static_cast<FONT_WEIGHT>(value); }

		public enum class FONT_STYLE
		{
			NORMAL = DWRITE_FONT_STYLE_NORMAL,
			OBLIQUE = DWRITE_FONT_STYLE_OBLIQUE,
			ITALIC = DWRITE_FONT_STYLE_ITALIC
		};
		inline DWRITE_FONT_STYLE makeD2D(FONT_STYLE value) { return static_cast<DWRITE_FONT_STYLE>(value); }
		inline FONT_STYLE fromD2D(DWRITE_FONT_STYLE value) { return static_cast<FONT_STYLE>(value); }

		public enum class FONT_STRETCH
		{
			UNDEFINED = DWRITE_FONT_STRETCH_UNDEFINED,
			ULTRA_CONDENSED = DWRITE_FONT_STRETCH_ULTRA_CONDENSED,
			EXTRA_CONDENSED = DWRITE_FONT_STRETCH_EXTRA_CONDENSED,
			CONDENSED = DWRITE_FONT_STRETCH_CONDENSED,
			SEMI_CONDENSED = DWRITE_FONT_STRETCH_SEMI_CONDENSED,
			NORMAL = DWRITE_FONT_STRETCH_NORMAL,
			MEDIUM = DWRITE_FONT_STRETCH_MEDIUM,
			SEMI_EXPANDED = DWRITE_FONT_STRETCH_SEMI_EXPANDED,
			EXPANDED = DWRITE_FONT_STRETCH_EXPANDED,
			EXTRA_EXPANDED = DWRITE_FONT_STRETCH_EXTRA_EXPANDED,
			ULTRA_EXPANDED = DWRITE_FONT_STRETCH_ULTRA_EXPANDED
		};
		inline DWRITE_FONT_STRETCH makeD2D(FONT_STRETCH value) { return static_cast<DWRITE_FONT_STRETCH>(value); }
		inline FONT_STRETCH fromD2D(DWRITE_FONT_STRETCH value) { return static_cast<FONT_STRETCH>(value); }

		public enum class PARAGRAPH_ALIGNMENT
		{
			/// <summary>
			/// The first line of paragraph is aligned to the flow's beginning edge of the layout box.
			/// </summary>
			Near = DWRITE_PARAGRAPH_ALIGNMENT_NEAR,
			/// <summary>
			/// The last line of paragraph is aligned to the flow's ending edge of the layout box.
			/// </summary>
			Far = DWRITE_PARAGRAPH_ALIGNMENT_FAR,
			/// <summary>
			/// The center of the paragraph is aligned to the center of the flow of the layout box.
			/// </summary>
			Center = DWRITE_PARAGRAPH_ALIGNMENT_CENTER
		};

		public enum class READING_DIRECTION 
		{
			LEFT_TO_RIGHT = DWRITE_READING_DIRECTION_LEFT_TO_RIGHT, 
			RIGHT_TO_LEFT = DWRITE_READING_DIRECTION_RIGHT_TO_LEFT 
		};

		public enum class TEXT_ALIGNMENT 
		{  
			Leading = DWRITE_TEXT_ALIGNMENT_LEADING, 
			Trailing = DWRITE_TEXT_ALIGNMENT_TRAILING, 
			Center = DWRITE_TEXT_ALIGNMENT_CENTER, 
			Justified = DWRITE_TEXT_ALIGNMENT_JUSTIFIED 
		};

		public enum class WORD_WRAPPING 
		{
			Wrap = DWRITE_WORD_WRAPPING_WRAP, 
			NoWrap = DWRITE_WORD_WRAPPING_NO_WRAP 
		};

		/// <summary>
		/// Typographic feature of text supplied by the font.
		/// </summary>
		public enum class FontFeatureTag
		{
			AlternativeFractions               = 0x63726661, // 'afrc'
			PetiteCapitalsFromCapitals       = 0x63703263, // 'c2pc'
			SmallCapitalsFromCapitals        = 0x63733263, // 'c2sc'
			ContextualAalternates               = 0x746c6163, // 'calt'
			CaseSensitiveForms                = 0x65736163, // 'case'
			GlyphCompositionDecomposition     = 0x706d6363, // 'ccmp'
			ContextualLigatures                = 0x67696c63, // 'clig'
			CapitalSpacing                     = 0x70737063, // 'cpsp'
			ContextualSwash                    = 0x68777363, // 'cswh'
			CursivePositioning                 = 0x73727563, // 'curs'
			Default                             = 0x746c6664, // 'dflt'
			DiscretionaryLigatures             = 0x67696c64, // 'dlig'
			ExpertForms                        = 0x74707865, // 'expt'
			Fractions                           = 0x63617266, // 'frac'
			FullWidth                          = 0x64697766, // 'fwid'
			HalfForms                          = 0x666c6168, // 'half'
			HalantForms                        = 0x6e6c6168, // 'haln'
			AlternateHalfWidth                = 0x746c6168, // 'halt'
			HistoricalForms                    = 0x74736968, // 'hist'
			HorizontalKanaAlternates          = 0x616e6b68, // 'hkna'
			HistoricalLigatures                = 0x67696c68, // 'hlig'
			HalfWidth                          = 0x64697768, // 'hwid'
			HojoKanjiForms                    = 0x6f6a6f68, // 'hojo'
			Jis04Forms                         = 0x3430706a, // 'jp04'
			Jis78Forms                         = 0x3837706a, // 'jp78'
			Jis83Forms                         = 0x3338706a, // 'jp83'
			Jis90Forms                         = 0x3039706a, // 'jp90'
			Kerning                             = 0x6e72656b, // 'kern'
			StandardLigatures                  = 0x6167696c, // 'liga'
			LiningFigures                      = 0x6d756e6c, // 'lnum'
			LocalizedForms                     = 0x6c636f6c, // 'locl'
			MarkPositioning                    = 0x6b72616d, // 'mark'
			Mathematical_greek                  = 0x6b72676d, // 'mgrk'
			MarkToMarkPositioning            = 0x6b6d6b6d, // 'mkmk'
			AlternateAnnotationForms          = 0x746c616e, // 'nalt'
			NlcKanjiForms                     = 0x6b636c6e, // 'nlck'
			OldStyleFigures                   = 0x6d756e6f, // 'onum'
			Ordinals                            = 0x6e64726f, // 'ordn'
			ProportionalAlternateWidth        = 0x746c6170, // 'palt'
			PetiteCapitals                     = 0x70616370, // 'pcap'
			ProportionalFigures                = 0x6d756e70, // 'pnum'
			ProportionalWidths                 = 0x64697770, // 'pwid'
			QuarterWidths                      = 0x64697771, // 'qwid'
			RequiredLigatures                  = 0x67696c72, // 'rlig'
			RubyNotationForms                 = 0x79627572, // 'ruby'
			StylisticAlternates                = 0x746c6173, // 'salt'
			ScientificInferiors                = 0x666e6973, // 'sinf'
			SmallCapitals                      = 0x70636d73, // 'smcp'
			SimplifiedForms                    = 0x6c706d73, // 'smpl'
			StylisticSet1                     = 0x31307373, // 'ss01'
			StylisticSet2                     = 0x32307373, // 'ss02'
			StylisticSet3                     = 0x33307373, // 'ss03'
			StylisticSet4                     = 0x34307373, // 'ss04'
			StylisticSet5                     = 0x35307373, // 'ss05'
			StylisticSet6                     = 0x36307373, // 'ss06'
			StylisticSet7                     = 0x37307373, // 'ss07'
			StylisticSet8                     = 0x38307373, // 'ss08'
			StylisticSet9                     = 0x39307373, // 'ss09'
			StylisticSet10                    = 0x30317373, // 'ss10'
			StylisticSet11                    = 0x31317373, // 'ss11'
			StylisticSet12                    = 0x32317373, // 'ss12'
			StylisticSet13                    = 0x33317373, // 'ss13'
			StylisticSet14                    = 0x34317373, // 'ss14'
			StylisticSet15                    = 0x35317373, // 'ss15'
			StylisticSet16                    = 0x36317373, // 'ss16'
			StylisticSet17                    = 0x37317373, // 'ss17'
			StylisticSet18                    = 0x38317373, // 'ss18'
			StylisticSet19                    = 0x39317373, // 'ss19'
			StylisticSet20                    = 0x30327373, // 'ss20'
			Subscript                           = 0x73627573, // 'subs'
			Superscript                         = 0x73707573, // 'sups'
			Swash                               = 0x68737773, // 'swsh'
			Titling                             = 0x6c746974, // 'titl'
			TraditionalNameForms              = 0x6d616e74, // 'tnam'
			TabularFigures                     = 0x6d756e74, // 'tnum'
			TraditionalForms                   = 0x64617274, // 'trad'
			ThirdWidths                        = 0x64697774, // 'twid'
			Unicase                             = 0x63696e75, // 'unic'
			VerticalWriting                    = 0x74726576, // 'vert'
			VerticalAlternatesAndRotation    = 0x32747276, // 'vrt2'
			SlashedZero                        = 0x6f72657a, // 'zero'
		};
	}
	namespace D3D
	{
		public enum class InputClassification
		{
			PerVertexData =  D3D11_INPUT_PER_VERTEX_DATA,
			PerInstanceData = D3D11_INPUT_PER_INSTANCE_DATA
		};
		inline D3D11_INPUT_CLASSIFICATION makeD3D(InputClassification value) { return static_cast<D3D11_INPUT_CLASSIFICATION>(value); }
		inline InputClassification fromD3D(D3D11_INPUT_CLASSIFICATION value) { return static_cast<InputClassification>(value); }


		public enum class Map
		{ 
		  Read = D3D11_MAP_READ, // =1
		  Write = D3D11_MAP_WRITE               ,//= 2,
		  ReadWrite = D3D11_MAP_READ_WRITE         ,// = 3,
		  WriteDiscard = D3D11_MAP_WRITE_DISCARD      ,// = 4,
		  WriteNoOverwrite = D3D11_MAP_WRITE_NO_OVERWRITE//  = 5
		};
		inline D3D11_MAP makeD3D(Map map) { return static_cast<D3D11_MAP>(map); }

		public enum class MapFlag 
		{ 
			None = 0,
			DoNotWait = D3D11_MAP_FLAG_DO_NOT_WAIT, //  = 0x100000L
		};

		public enum class ResourceMiscFlag 
		{ 
			None = 0,
			GenerateMips = D3D11_RESOURCE_MISC_GENERATE_MIPS                   ,
			Shared = D3D11_RESOURCE_MISC_SHARED                          ,
			TextureCube = D3D11_RESOURCE_MISC_TEXTURECUBE                     ,
			DrawIndirectArgs = D3D11_RESOURCE_MISC_DRAWINDIRECT_ARGS               ,
			AllowRawViews = D3D11_RESOURCE_MISC_BUFFER_ALLOW_RAW_VIEWS          ,
			BufferStructured = D3D11_RESOURCE_MISC_BUFFER_STRUCTURED               ,
			ResourceClamp = D3D11_RESOURCE_MISC_RESOURCE_CLAMP                  ,
			SharedKeyedMutex = D3D11_RESOURCE_MISC_SHARED_KEYEDMUTEX               ,
			GDICompatible = D3D11_RESOURCE_MISC_GDI_COMPATIBLE                  ,
			SharedNTHandle = D3D11_RESOURCE_MISC_SHARED_NTHANDLE                 ,
			RestrictedContext = D3D11_RESOURCE_MISC_RESTRICTED_CONTENT              ,
			RestrictSharedResource = D3D11_RESOURCE_MISC_RESTRICT_SHARED_RESOURCE        ,
			SharedResourceDriver = D3D11_RESOURCE_MISC_RESTRICT_SHARED_RESOURCE_DRIVER ,
			Guarded = D3D11_RESOURCE_MISC_GUARDED                         ,
		};
		inline D3D11_RESOURCE_MISC_FLAG makeD3D(ResourceMiscFlag flag) { return static_cast<D3D11_RESOURCE_MISC_FLAG>(flag); }
		inline ResourceMiscFlag fromD3D(D3D11_RESOURCE_MISC_FLAG flag) { return static_cast<ResourceMiscFlag>(flag); }

		public enum class BindFlag
		{
			VertexBuffer    = D3D11_BIND_VERTEX_BUFFER	,
			IndexBuffer     = D3D11_BIND_INDEX_BUFFER	    ,
			ConstantBuffer  = D3D11_BIND_CONSTANT_BUFFER	,
			ShaderResource  = D3D11_BIND_SHADER_RESOURCE	,
			StreamOutput    = D3D11_BIND_STREAM_OUTPUT	,
			RenderTarget    = D3D11_BIND_RENDER_TARGET	,
			DepthStencil    = D3D11_BIND_DEPTH_STENCIL	,
			UnorderedAccess = D3D11_BIND_UNORDERED_ACCESS	,
			Decoder         = D3D11_BIND_DECODER	        ,
			VideoEncoder    = D3D11_BIND_VIDEO_ENCODER	,
		};
		inline D3D11_BIND_FLAG makeD3D(BindFlag flag) { return static_cast<D3D11_BIND_FLAG>(flag); }
		inline BindFlag fromD3D(D3D11_BIND_FLAG flag) { return static_cast<BindFlag>(flag); }

		 public enum class CPUAccessFlag
		 { 
			None  = 0,
			Write = D3D11_CPU_ACCESS_WRITE,
			Read  = D3D11_CPU_ACCESS_READ
		};
		inline D3D11_CPU_ACCESS_FLAG makeD3D(CPUAccessFlag flag) { return static_cast<D3D11_CPU_ACCESS_FLAG>(flag); }
		inline CPUAccessFlag fromD3D(D3D11_CPU_ACCESS_FLAG flag) { return static_cast<CPUAccessFlag>(flag); }

		public enum class USAGE
		{
			DEFAULT = D3D11_USAGE_DEFAULT,
			IMMUTABLE = D3D11_USAGE_IMMUTABLE,
			DYNAMIC = D3D11_USAGE_DYNAMIC,
			STAGING = D3D11_USAGE_STAGING
		};
		inline bool IsUSAGE(D3D::USAGE value)
		{
			switch (value)
			{
			case DXBase::D3D::USAGE::DEFAULT:
			case DXBase::D3D::USAGE::IMMUTABLE:
			case DXBase::D3D::USAGE::DYNAMIC:
			case DXBase::D3D::USAGE::STAGING:
				return true;
			default:
				return false;
			}
		}
		inline D3D11_USAGE makeD3D(USAGE u)
		{
			if (IsUSAGE(u))
				return static_cast<D3D11_USAGE>(u);
			return D3D11_USAGE_DEFAULT;
		}
		inline USAGE fromD3D(D3D11_USAGE u)
		{
			return static_cast<USAGE>(u);
		}

		[Platform::Metadata::Flags]
		public enum class ShaderType : uint32
		{
			// I evenly split the number to leave room for future shader type! ^^
			Vertex     = 1<<0, 
			Hull       = 1<<3,
			Domain     = 1<<6,
			Geometry   = 1<<9,
			Pixel      = 1<<12,
			Compute    = 1<<20,
		};

		public enum class Topology
		{
			Undefined	                = D3D_PRIMITIVE_TOPOLOGY_UNDEFINED,
			Pointlist	                = D3D_PRIMITIVE_TOPOLOGY_POINTLIST,
			Linelist	                = D3D_PRIMITIVE_TOPOLOGY_LINELIST,
			Linestrip	                = D3D_PRIMITIVE_TOPOLOGY_LINESTRIP,
			Trianglelist	            = D3D_PRIMITIVE_TOPOLOGY_TRIANGLELIST,
			Trianglestrip	            = D3D_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP,
			Linelist_adj	            = D3D_PRIMITIVE_TOPOLOGY_LINELIST_ADJ,
			Linestrip_adj	            = D3D_PRIMITIVE_TOPOLOGY_LINESTRIP_ADJ,
			Trianglelist_adj	        = D3D_PRIMITIVE_TOPOLOGY_TRIANGLELIST_ADJ,
			Trianglestrip_adj	        = D3D_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP_ADJ,
			Control_1_point_patchlist	= D3D_PRIMITIVE_TOPOLOGY_1_CONTROL_POINT_PATCHLIST,
			Control_2_point_patchlist	= D3D_PRIMITIVE_TOPOLOGY_2_CONTROL_POINT_PATCHLIST,
			Control_3_point_patchlist	= D3D_PRIMITIVE_TOPOLOGY_3_CONTROL_POINT_PATCHLIST,
			Control_4_point_patchlist	= D3D_PRIMITIVE_TOPOLOGY_4_CONTROL_POINT_PATCHLIST,
			Control_5_point_patchlist	= D3D_PRIMITIVE_TOPOLOGY_5_CONTROL_POINT_PATCHLIST,
			Control_6_point_patchlist	= D3D_PRIMITIVE_TOPOLOGY_6_CONTROL_POINT_PATCHLIST,
			Control_7_point_patchlist	= D3D_PRIMITIVE_TOPOLOGY_7_CONTROL_POINT_PATCHLIST,
			Control_8_point_patchlist	= D3D_PRIMITIVE_TOPOLOGY_8_CONTROL_POINT_PATCHLIST,
			Control_9_point_patchlist	= D3D_PRIMITIVE_TOPOLOGY_9_CONTROL_POINT_PATCHLIST,
			Control_10_point_patchlist	= D3D_PRIMITIVE_TOPOLOGY_10_CONTROL_POINT_PATCHLIST,
			Control_11_point_patchlist	= D3D_PRIMITIVE_TOPOLOGY_11_CONTROL_POINT_PATCHLIST,
			Control_12_point_patchlist	= D3D_PRIMITIVE_TOPOLOGY_12_CONTROL_POINT_PATCHLIST,
			Control_13_point_patchlist	= D3D_PRIMITIVE_TOPOLOGY_13_CONTROL_POINT_PATCHLIST,
			Control_14_point_patchlist	= D3D_PRIMITIVE_TOPOLOGY_14_CONTROL_POINT_PATCHLIST,
			Control_15_point_patchlist	= D3D_PRIMITIVE_TOPOLOGY_15_CONTROL_POINT_PATCHLIST,
			Control_16_point_patchlist	= D3D_PRIMITIVE_TOPOLOGY_16_CONTROL_POINT_PATCHLIST,
			Control_17_point_patchlist	= D3D_PRIMITIVE_TOPOLOGY_17_CONTROL_POINT_PATCHLIST,
			Control_18_point_patchlist	= D3D_PRIMITIVE_TOPOLOGY_18_CONTROL_POINT_PATCHLIST,
			Control_19_point_patchlist	= D3D_PRIMITIVE_TOPOLOGY_19_CONTROL_POINT_PATCHLIST,
			Control_20_point_patchlist	= D3D_PRIMITIVE_TOPOLOGY_20_CONTROL_POINT_PATCHLIST,
			Control_21_point_patchlist	= D3D_PRIMITIVE_TOPOLOGY_21_CONTROL_POINT_PATCHLIST,
			Control_22_point_patchlist	= D3D_PRIMITIVE_TOPOLOGY_22_CONTROL_POINT_PATCHLIST,
			Control_23_point_patchlist	= D3D_PRIMITIVE_TOPOLOGY_23_CONTROL_POINT_PATCHLIST,
			Control_24_point_patchlist	= D3D_PRIMITIVE_TOPOLOGY_24_CONTROL_POINT_PATCHLIST,
			Control_25_point_patchlist	= D3D_PRIMITIVE_TOPOLOGY_25_CONTROL_POINT_PATCHLIST,
			Control_26_point_patchlist	= D3D_PRIMITIVE_TOPOLOGY_26_CONTROL_POINT_PATCHLIST,
			Control_27_point_patchlist	= D3D_PRIMITIVE_TOPOLOGY_27_CONTROL_POINT_PATCHLIST,
			Control_28_point_patchlist	= D3D_PRIMITIVE_TOPOLOGY_28_CONTROL_POINT_PATCHLIST,
			Control_29_point_patchlist	= D3D_PRIMITIVE_TOPOLOGY_29_CONTROL_POINT_PATCHLIST,
			Control_30_point_patchlist	= D3D_PRIMITIVE_TOPOLOGY_30_CONTROL_POINT_PATCHLIST,
			Control_31_point_patchlist	= D3D_PRIMITIVE_TOPOLOGY_31_CONTROL_POINT_PATCHLIST,
			Control_32_point_patchlist	= D3D_PRIMITIVE_TOPOLOGY_32_CONTROL_POINT_PATCHLIST
		};
		inline bool IsTOPOLOGY(Topology t)
		{
			auto i = static_cast<D3D_PRIMITIVE_TOPOLOGY>(t);
			return i >= D3D_PRIMITIVE_TOPOLOGY_UNDEFINED && i <= D3D_PRIMITIVE_TOPOLOGY_32_CONTROL_POINT_PATCHLIST;
		}
		inline D3D_PRIMITIVE_TOPOLOGY makeD3D(Topology value) { return static_cast<D3D_PRIMITIVE_TOPOLOGY>(value); }
		inline Topology fromD3D(D3D_PRIMITIVE_TOPOLOGY value) { return static_cast<Topology>(value); }

		public enum class FILL_MODE
		{
			SOLID = D3D11_FILL_SOLID,
			WIREFRAME = D3D11_FILL_WIREFRAME,
		};
		inline bool IsFILL_MODE(FILL_MODE value)
		{
			switch (value)
			{
			case DXBase::D3D::FILL_MODE::SOLID:
			case DXBase::D3D::FILL_MODE::WIREFRAME:
				return true;
			default:
				return false;
			}
		}

		public enum class CULL_MODE
		{
			NONE = D3D11_CULL_NONE,
			FRONT = D3D11_CULL_FRONT,
			BACK = D3D11_CULL_BACK
		};
		inline bool IsCULL_MODE(CULL_MODE value)
		{
			switch (value)
			{
			case DXBase::D3D::CULL_MODE::NONE:
			case DXBase::D3D::CULL_MODE::FRONT:
			case DXBase::D3D::CULL_MODE::BACK:
				return true;
			default:
				return false;
			}
		}

		public enum class FILTER
		{
			MIN_MAG_MIP_POINT = D3D11_FILTER_MIN_MAG_MIP_POINT,
			MIN_MAG_POINT_MIP_LINEAR = D3D11_FILTER_MIN_MAG_POINT_MIP_LINEAR,
			MIN_POINT_MAG_LINEAR_MIP_POINT = D3D11_FILTER_MIN_POINT_MAG_LINEAR_MIP_POINT,
			MIN_POINT_MAG_MIP_LINEAR = D3D11_FILTER_MIN_POINT_MAG_MIP_LINEAR,
			MIN_LINEAR_MAG_MIP_POINT = D3D11_FILTER_MIN_LINEAR_MAG_MIP_POINT,
			MIN_LINEAR_MAG_POINT_MIP_LINEAR = D3D11_FILTER_MIN_LINEAR_MAG_POINT_MIP_LINEAR,
			MIN_MAG_LINEAR_MIP_POINT = D3D11_FILTER_MIN_MAG_LINEAR_MIP_POINT,
			MIN_MAG_MIP_LINEAR = D3D11_FILTER_MIN_MAG_MIP_LINEAR,
			ANISOTROPIC = D3D11_FILTER_ANISOTROPIC,
			COMPARISON_MIN_MAG_MIP_POINT = D3D11_FILTER_COMPARISON_MIN_MAG_MIP_POINT,
			COMPARISON_MIN_MAG_POINT_MIP_LINEAR = D3D11_FILTER_COMPARISON_MIN_MAG_POINT_MIP_LINEAR,
			COMPARISON_MIN_POINT_MAG_LINEAR_MIP_POINT = D3D11_FILTER_COMPARISON_MIN_POINT_MAG_LINEAR_MIP_POINT,
			COMPARISON_MIN_POINT_MAG_MIP_LINEAR = D3D11_FILTER_COMPARISON_MIN_POINT_MAG_MIP_LINEAR,
			COMPARISON_MIN_LINEAR_MAG_MIP_POINT = D3D11_FILTER_COMPARISON_MIN_LINEAR_MAG_MIP_POINT,
			COMPARISON_MIN_LINEAR_MAG_POINT_MIP_LINEAR = D3D11_FILTER_COMPARISON_MIN_LINEAR_MAG_POINT_MIP_LINEAR,
			COMPARISON_MIN_MAG_LINEAR_MIP_POINT = D3D11_FILTER_COMPARISON_MIN_MAG_LINEAR_MIP_POINT,
			COMPARISON_MIN_MAG_MIP_LINEAR = D3D11_FILTER_COMPARISON_MIN_MAG_MIP_LINEAR,
			COMPARISON_ANISOTROPIC = D3D11_FILTER_COMPARISON_ANISOTROPIC
		};

		public enum class TEXTURE_ADDRESS_MODE
		{
			WRAP = D3D11_TEXTURE_ADDRESS_WRAP,
			MIRROR = D3D11_TEXTURE_ADDRESS_MIRROR,
			CLAMP = D3D11_TEXTURE_ADDRESS_CLAMP,
			BORDER = D3D11_TEXTURE_ADDRESS_BORDER,
			MIRROR_ONCE = D3D11_TEXTURE_ADDRESS_MIRROR_ONCE
		};
		inline bool IsTEXTURE_ADDRESS_MODE(TEXTURE_ADDRESS_MODE t)
		{
			auto i = static_cast<D3D11_TEXTURE_ADDRESS_MODE>(t);
			return i >= D3D11_TEXTURE_ADDRESS_WRAP && i <= D3D11_TEXTURE_ADDRESS_MIRROR_ONCE;
		}

		public enum class COMPARISON_FUNC
		{
			NEVER = D3D11_COMPARISON_NEVER,
			LESS = D3D11_COMPARISON_LESS,
			EQUAL = D3D11_COMPARISON_EQUAL,
			LESS_EQUAL = D3D11_COMPARISON_LESS_EQUAL,
			GREATER = D3D11_COMPARISON_GREATER,
			NOT_EQUAL = D3D11_COMPARISON_NOT_EQUAL,
			GREATER_EQUAL = D3D11_COMPARISON_GREATER_EQUAL,
			ALWAYS = D3D11_COMPARISON_ALWAYS
		};
		inline bool IsCOMPARISON_FUNC(COMPARISON_FUNC t)
		{
			auto i = static_cast<D3D11_COMPARISON_FUNC>(t);
			return i >= D3D11_COMPARISON_NEVER && i <= D3D11_COMPARISON_ALWAYS;
		}

		public enum class DEPTH_WRITE_MASK
		{
			ZERO = D3D11_DEPTH_WRITE_MASK_ZERO,
			ALL = D3D11_DEPTH_WRITE_MASK_ALL
		};

		public enum class STENCIL_OP
		{
			KEEP = D3D11_STENCIL_OP_KEEP,
			ZERO = D3D11_STENCIL_OP_ZERO,
			REPLACE = D3D11_STENCIL_OP_REPLACE,
			INCR_SAT = D3D11_STENCIL_OP_INCR_SAT,
			DECR_SAT = D3D11_STENCIL_OP_DECR_SAT,
			INVERT = D3D11_STENCIL_OP_INVERT,
			INCR = D3D11_STENCIL_OP_INCR,
			DECR = D3D11_STENCIL_OP_DECR
		};

		public value struct DEPTH_STENCILOP_DESC
		{
			STENCIL_OP StencilFailOp;
			STENCIL_OP StencilDepthFailOp;
			STENCIL_OP StencilPassOp;
			COMPARISON_FUNC StencilFunc;
		};

		inline void InitSrcDst(DEPTH_STENCILOP_DESC& src, D3D11_DEPTH_STENCILOP_DESC& dst)
		{
			dst.StencilFailOp = static_cast<D3D11_STENCIL_OP>(src.StencilFailOp);
			dst.StencilDepthFailOp = static_cast<D3D11_STENCIL_OP>(src.StencilDepthFailOp);
			dst.StencilPassOp = static_cast<D3D11_STENCIL_OP>(src.StencilPassOp);
			dst.StencilFunc = static_cast<D3D11_COMPARISON_FUNC>(src.StencilFunc);
		}
		inline void InitSrcDst(D3D11_DEPTH_STENCILOP_DESC& src, DEPTH_STENCILOP_DESC& dst)
		{
			dst.StencilFailOp = static_cast<STENCIL_OP>(src.StencilFailOp);
			dst.StencilDepthFailOp = static_cast<STENCIL_OP>(src.StencilDepthFailOp);
			dst.StencilPassOp = static_cast<STENCIL_OP>(src.StencilPassOp);
			dst.StencilFunc = static_cast<COMPARISON_FUNC>(src.StencilFunc);
		}

		public enum class BLEND
		{
			ZERO = D3D11_BLEND_ZERO,
			ONE = D3D11_BLEND_ONE,
			SRC_COLOR = D3D11_BLEND_SRC_COLOR,
			INV_SRC_COLOR = D3D11_BLEND_INV_SRC_COLOR,
			SRC_ALPHA = D3D11_BLEND_SRC_ALPHA,
			INV_SRC_ALPHA = D3D11_BLEND_INV_SRC_ALPHA,
			DEST_ALPHA = D3D11_BLEND_DEST_ALPHA,
			INV_DEST_ALPHA = D3D11_BLEND_INV_DEST_ALPHA,
			DEST_COLOR = D3D11_BLEND_DEST_COLOR,
			INV_DEST_COLOR = D3D11_BLEND_INV_DEST_COLOR,
			SRC_ALPHA_SAT = D3D11_BLEND_SRC_ALPHA_SAT,
			BLEND_FACTOR = D3D11_BLEND_BLEND_FACTOR,
			INV_BLEND_FACTOR = D3D11_BLEND_INV_BLEND_FACTOR,
			SRC1_COLOR = D3D11_BLEND_SRC1_COLOR,
			INV_SRC1_COLOR = D3D11_BLEND_INV_SRC1_COLOR,
			SRC1_ALPHA = D3D11_BLEND_SRC1_ALPHA,
			INV_SRC1_ALPHA = D3D11_BLEND_INV_SRC1_ALPHA
		};
		inline bool IsBLEND(BLEND b)
		{
			auto b2 = static_cast<D3D11_BLEND>(b);
			return b2 >= D3D11_BLEND_ZERO && b2 <= D3D11_BLEND_INV_SRC1_ALPHA;
		}

		public enum class BLEND_OP
		{
			ADD = D3D11_BLEND_OP_ADD,
			SUBTRACT = D3D11_BLEND_OP_SUBTRACT,
			REV_SUBTRACT = D3D11_BLEND_OP_REV_SUBTRACT,
			MIN = D3D11_BLEND_OP_MIN,
			MAX = D3D11_BLEND_OP_MAX
		};
		inline bool IsBLEND_OP(BLEND_OP b)
		{
			auto b2 = static_cast<D3D11_BLEND_OP>(b);
			return b2 >= D3D11_BLEND_OP_ADD && b2 <= D3D11_BLEND_OP_MAX;
		}

		public value struct RENDER_TARGET_BLEND_DESC
		{
			bool BlendEnable;
			BLEND SrcBlend;
			BLEND DestBlend;
			BLEND_OP BlendOp;
			BLEND SrcBlendAlpha;
			BLEND DestBlendAlpha;
			BLEND_OP BlendOpAlpha;
			UINT8 RenderTargetWriteMask;
		};

		inline void InitSrcDst(RENDER_TARGET_BLEND_DESC& src, D3D11_RENDER_TARGET_BLEND_DESC& dst)
		{
			dst.BlendEnable = src.BlendEnable;
			dst.SrcBlend = static_cast<D3D11_BLEND>(src.SrcBlend);
			dst.DestBlend = static_cast<D3D11_BLEND>(src.DestBlend);
			dst.BlendOp = static_cast<D3D11_BLEND_OP>(src.BlendOp);
			dst.SrcBlendAlpha = static_cast<D3D11_BLEND>(src.SrcBlendAlpha);
			dst.DestBlendAlpha = static_cast<D3D11_BLEND>(src.DestBlendAlpha);
			dst.BlendOpAlpha = static_cast<D3D11_BLEND_OP>(src.BlendOpAlpha);
			dst.RenderTargetWriteMask = src.RenderTargetWriteMask;
		}
		inline void InitSrcDst(D3D11_RENDER_TARGET_BLEND_DESC& src, RENDER_TARGET_BLEND_DESC& dst)
		{
			dst.BlendEnable = src.BlendEnable ? true : false;
			dst.SrcBlend = static_cast<BLEND>(src.SrcBlend);
			dst.DestBlend = static_cast<BLEND>(src.DestBlend);
			dst.BlendOp = static_cast<BLEND_OP>(src.BlendOp);
			dst.SrcBlendAlpha = static_cast<BLEND>(src.SrcBlendAlpha);
			dst.DestBlendAlpha = static_cast<BLEND>(src.DestBlendAlpha);
			dst.BlendOpAlpha = static_cast<BLEND_OP>(src.BlendOpAlpha);
			dst.RenderTargetWriteMask = src.RenderTargetWriteMask;
		}
	}
	namespace D2D
	{
		public enum class CAP_STYLE
		{
			FLAT = D2D1_CAP_STYLE_FLAT,
			SQUARE = D2D1_CAP_STYLE_SQUARE,
			ROUND = D2D1_CAP_STYLE_ROUND,
			TRIANGLE = D2D1_CAP_STYLE_TRIANGLE,
			//FORCE_DWORD = D2D1_CAP_STYLE_FORCE_DWORD
		};
		public enum class LINE_JOIN
		{
			MITER = D2D1_LINE_JOIN_MITER,
			BEVEL = D2D1_LINE_JOIN_BEVEL,
			ROUND = D2D1_LINE_JOIN_ROUND,
			MITER_OR_BEVEL = D2D1_LINE_JOIN_MITER_OR_BEVEL,
			//FORCE_DWORD = D2D1_LINE_JOIN_FORCE_DWORD
		};
		public enum class DASH_STYLE
		{
			SOLID = D2D1_DASH_STYLE_SOLID,
			DASH = D2D1_DASH_STYLE_DASH,
			DOT = D2D1_DASH_STYLE_DOT,
			DASH_DOT = D2D1_DASH_STYLE_DASH_DOT,
			DASH_DOT_DOT = D2D1_DASH_STYLE_DASH_DOT_DOT,
			CUSTOM = D2D1_DASH_STYLE_CUSTOM,
			//FORCE_DWORD = D2D1_DASH_STYLE_FORCE_DWORD
		};

		public enum class DRAW_TEXT_OPTIONS
		{
			NO_SNAP = D2D1_DRAW_TEXT_OPTIONS_NO_SNAP,
			CLIP = D2D1_DRAW_TEXT_OPTIONS_CLIP,
			NONE = D2D1_DRAW_TEXT_OPTIONS_NONE,
			//FORCE_DWORD = D2D1_DRAW_TEXT_OPTIONS_FORCE_DWORD
		};
	}
}